<template>
  <view class="box" @click="informationNoBubbles = false">
    <view
      class="headTop"
      :class="[clarity <= 0.2 ? 'anamorphism' : '']"
      :style="[
        { paddingTop: statusBarHeight1 + 'px' },
        { paddingBottom: clarity >= 0.9 ? '0' : '1px' },
        { borderBottom: clarity >= 0.9 ? '1px solid #eee' : 'none' },
        {
          backgroundColor:
            clarity <= 0.2 ? 'rgba(255,255,255,0)' : 'rgba(255,255,255,' + clarity + ')',
        },
      ]"
    >
      <!--  #ifdef APP-PLUS -->
      <image
        class="image2"
        v-if="clarity <= 0.2"
        @click="fanhui"
        src="https://pic.bangbangtongcheng.com/static/fanhui_bai.png"
        v-show="titIndex != 2"
      />
      <image
        class="image2"
        v-else
        @click="fanhui"
        src="https://pic.bangbangtongcheng.com/8937350f727e4eeda6e97ab0d7398e65"
        v-show="titIndex != 2"
      />
      <view class="" v-show="titIndex != 2" style="display: flex; align-items: center">
        <template v-if="clarity <= 0.2">
          <image
            class="image1"
            style="margin-right: 20rpx"
            @click="fn"
            src="https://pic.bangbangtongcheng.com/5bfdd20804944e49ac44a6d4acbf1225"
          />
        </template>
        <template v-else>
          <image
            class="image1"
            style="margin-right: 20rpx"
            @click="fn"
            src="https://pic.bangbangtongcheng.com/255a2fb6a0094877a4f67177f81c8373"
          />
        </template>
      </view>
      <!-- #endif -->
      <!-- #ifndef APP-PLUS -->
      <template v-if="beforePage">
        <image
          class="image2"
          v-if="clarity <= 0.2"
          @click="fanhui"
          src="https://pic.bangbangtongcheng.com/static/fanhui_bai.png"
        ></image>
        <image
          class="image2"
          v-else
          @click="fanhui"
          src="https://pic.bangbangtongcheng.com/8937350f727e4eeda6e97ab0d7398e65"
        ></image>
      </template>
      <template v-else>
        <image
          class="image2"
          v-if="clarity <= 0.2"
          @click="shouye"
          src="https://pic.bangbangtongcheng.com/273355a6b7cd4bcb8b4cf8baf9a4ad9a"
        ></image>
        <image
          class="image2"
          v-else
          @click="shouye"
          src="https://pic.bangbangtongcheng.com/fc915aba003f4504a80d16c7a8c9b348"
        ></image>
      </template>
      <!-- #endif -->
    </view>
    <view class="tit">
      <view v-if="titIndex == 1" class="banner">
        <swiper
          style="min-height: 0rpx; height: 500rpx"
          class="screen-swiper square-dot"
          :circular="true"
          :autoplay="true"
          indicator-active-color="#ffffff"
          interval="5000"
          duration="500"
          :current="current"
          :indicator-dots="false"
          @change="swiperC1"
        >
          <swiper-item
            v-for="(item, index) in swiperList"
            :key="index + 'ss'"
            @click="clickImg(swiperList, index)"
          >
            <image style="margin-top: 0px !important" :src="imgUrl + item" mode="aspectFill" />
          </swiper-item>
        </swiper>
      </view>
      <video
        v-if="titIndex == 2"
        class="video"
        :src="video"
        :poster="video + '?vframe/jpg/offset/0'"
      >
        <!-- #ifdef APP-PLUS -->
        <cover-view
          @click="titxuan(1)"
          style="
            width: 15%;
            height: 50rpx;
            background-color: #ffffff;
            z-index: 1;
            position: absolute;
            bottom: 10rpx;
            left: 45%;
            text-align: center;
            line-height: 45rpx;
            border-radius: 25px;
          "
        >
          图片</cover-view
        >
        <cover-view class="fenxiang" @click="Mores">更多</cover-view>
        <cover-view class="Wfanhui" @click="fanhui">
          <cover-image
            class="fanhui"
            @click.stop="fanhui"
            src="https://pic.bangbangtongcheng.com/static/fanhui_bai.png"
          ></cover-image>
        </cover-view>
        <!-- #endif -->
      </video>
      <view class="butbox">
        <view
          :class="titIndex == 2 ? 'but xuan' : 'but'"
          @click="titxuan(2)"
          v-if="video != ''"
          style="margin-right: 10rpx"
          >视频</view
        >
        <view class="tu">
          <view :class="titIndex == 1 ? 'but xuan' : 'but'" @click="titxuan(1)">图片</view>
        </view>
      </view>
      <view
        class="rotaryCastDiagram"
        style="background: rgba(51, 51, 51, 0.65); color: #fff"
        v-if="titIndex != 2"
      >
        {{ current + 1 }}/{{ swiperList.length }}
      </view>
    </view>
    <view
      class=""
      @click.stop="informationNoBubbles = !informationNoBubbles"
      style="
        margin-top: 30rpx;
        margin-left: 30rpx;
        margin-bottom: 12rpx;
        color: #64b6a8;
        position: relative;
      "
    >
      信息编号：{{ data.id }}
      <view class="informationNoBubble" v-if="informationNoBubbles">
        <view class="binds_1"> 信息编号是唯一的信息身份号码，可在帮帮同城进行准确搜索查找。 </view>
        <view class="binds_2"> 联系发布人时可通过信息编号确认信息。 </view>
      </view>
    </view>
    <view class="title1">
      {{ data.title }}
    </view>
    <view class="xmtitle">
      <view class="name">{{ data.entryName }}</view>
      <view class="jubao" @click="jubao">
        <image src="https://pic.bangbangtongcheng.com/static/jubao.png" />
        <view>举报</view>
      </view>
    </view>
    <view class="jieshao">
      <view class="name">
        <view class="name_left">项目介绍</view>
        <view class="name_right" @click="doorSeen" v-if="shopData.storeType != 3">
          <image
            class="name_right_image"
            src="https://pic.bangbangtongcheng.com/static/bbcz/smkg01.png"
            mode=""
          >
          </image>
          <span class="name_right_txt" v-if="!smkg_chage">上门看看</span>
          <span class="name_right_txt" v-else>上门看过</span>
        </view>
      </view>
      <view
        class="detail"
        style="margin-left: 30rpx; width: 690rpx; font-size: 15px; line-height: 24px"
      >
        {{ data.entryDescription }}</view
      >
    </view>
    <view class="technicianWill">
      <view class="name">项目详情</view>
      <view class="photograph">
        <image
          class="image1"
          @click="fwxmImg(swiperList, i)"
          v-for="(i, j) in swiperList"
          :key="j"
          :src="i"
          mode="aspectFill"
        ></image>
      </view>
    </view>
    <view class="carPosition">
      <view class="name">项目地址</view>
      <view class="map">
        <map
          class="AppMap"
          ref="map1"
          :scale="13"
          id="map1"
          :latitude="data.latitude"
          :longitude="data.longitude"
          :markers="markerList"
          @tap="openMap"
        ></map>
      </view>
    </view>
    <view class="mingpian" @click="userFy">
      <view class="name">{{ jjrInfo.nikeName || '未命名用户' }}</view>
      <view
        class="vip-label"
        v-if="jjrInfo.memberLevel"
        :style="{
          backgroundColor: colors[jjrInfo.memberLevel - 1].bgColor,
          borderColor: colors[jjrInfo.memberLevel - 1].lineColor,
          color: colors[jjrInfo.memberLevel - 1].wordColor,
        }"
      >
        {{ colors[jjrInfo.memberLevel - 1].level }}
      </view>
      <image
        class="img1"
        src="https://pic.bangbangtongcheng.com/static/my/header.png"
        v-if="jjrInfo.image == '' || !jjrInfo.image"
      />
      <image class="img1" :src="jjrInfo.image" v-else />
      <view class="img2" v-if="jjrInfo.isShop == 1">商家</view>
      <view class="img2" v-else-if="jjrInfo.isShop == 0 && jjrInfo.isAgent == 1">经纪人</view>
      <view class="img2" v-else>个人</view>
      <view class="xin" v-if="jjrInfo.score">
        <image
          class="img3"
          v-for="(item, index) in Number(jjrInfo.score)"
          :key="index + 'rr'"
          src="https://pic.bangbangtongcheng.com/static/xin_liang.png"
        />
        <image
          class="img3"
          v-for="(item, index) in 5 - Number(jjrInfo.score)"
          :key="index + 'tt'"
          src="https://pic.bangbangtongcheng.com/static/xin_hui.png"
        />
      </view>
      <view class="chakan" v-if="jjrInfo.isAgent == 1">查看TA的房源</view>
      <view class="chakan v-else">查看TA的信息</view>
      <image
        @click.stop="guanzhu"
        class="img4"
        v-if="userisCollection != 0"
        src="https://pic.bangbangtongcheng.com/static/ysc.png"
      />
      <image
        class="img4"
        @click.stop="guanzhu"
        v-else
        src="https://pic.bangbangtongcheng.com/static/guanzhu.png"
      />
      <view class="guan" style="right: 20rpx" v-if="userisCollection != 0" @click.stop="guanzhu"
        >已关注</view
      >
      <view class="guan" v-else @click.stop="guanzhu">关注</view>
    </view>
    <view class="mzsm">
      {{ disclaimers }}
    </view>
    <view class="dibu">
      <view class="zhiwei" v-if="data.userInfo" @click="userFy">
        <image
          class="img"
          src="https://pic.bangbangtongcheng.com/static/my/header.png"
          v-if="!data.userInfo.image"
        />
        <image class="img" :src="data.userInfo.image" v-else />
        {{ data.userInfo.nikeName || '未命名用户' }}
        <view class="xin" v-if="data.userInfo.score">
          <image
            class="img3"
            v-for="(item, index) in Number(data.userInfo.score)"
            :key="index + 'uu'"
            src="https://pic.bangbangtongcheng.com/static/xin_liang.png"
          />
          <image
            class="img3"
            v-for="(item, index) in 5 - data.userInfo.score"
            :key="index + 'pp'"
            src="https://pic.bangbangtongcheng.com/static/xin_hui.png"
          />
        </view>
      </view>
      <view class="shou" @click="sc">
        <image
          class="img"
          v-if="data.whetherCollection != 0"
          src="https://pic.bangbangtongcheng.com/static/ysc.png"
        />
        <image class="img" v-else src="https://pic.bangbangtongcheng.com/static/shoucang.png" />
        <p v-if="data.whetherCollection != 0">已收藏</p>
        <p v-else>收藏服务</p>
      </view>
      <!-- #ifdef APP-PLUS -->
      <view class="lian" @click="getPhone()">
        <image class="img" src="https://pic.bangbangtongcheng.com/static/dianhua.png" />
        <p>联系TA</p>
      </view>
      <!-- #endif -->
      <!-- #ifndef APP-PLUS -->
      <view class="lian" @click="onphone()">
        <image class="img" src="https://pic.bangbangtongcheng.com/static/dianhua.png" />
        <p>联系TA</p>
      </view>
      <!-- #endif -->
      <view class="liao" @click="chat">在线聊天</view>
    </view>
    <informationNo ref="informationNo"></informationNo>
    <uniBall></uniBall>
  </view>
</template>
<script>
  import permision from '@/js_sdk/wa-permission/permission.js'
  //#ifdef H5
  import wxshare from '../../utils/index.js'
  //#endif
  import { mapGetters } from 'vuex'
  export default {
    data() {
      return {
        fangfa: false,
        playstate: true,
        titIndex: 1,
        swiperList: [],
        swiperList1: [],
        furnituresss: [],
        weig: false,
        id: '',
        imgUrl: this.$imgSrc,
        data: {},
        video: '',
        lcType: 0,
        lou1: '',
        current: 0,
        current1: 0,
        limit: '',
        limit1: '',
        jjrInfo: {},
        userInfo: uni.getStorageSync('Pduser'),
        Count: '',
        isCollection: '',
        userisCollection: '',
        contraststate: false,
        housetype: 1,
        beforePage: '',
        // 变色
        clarity: 0,
        capsuleWidth: 0,
        imgList: [],
        disclaimers: '',
        indexss: 1,
        llindex: 1,
        markerList: [],
        colors: [
          {
            bgColor: '#E9EFEF',
            wordColor: '#60807D',
            lineColor: '#B6C4C3',
            level: '青铜会员',
          },
          {
            bgColor: '#F7F7F7',
            wordColor: '#A3AAB0',
            lineColor: '#D2D9E0',
            level: '白银会员',
          },
          {
            bgColor: '#FFF8DE',
            wordColor: '#CEAB21',
            lineColor: '#D3CAB2',
            level: '黄金会员',
          },
          {
            bgColor: '#EDFAFF',
            wordColor: '#59B0E6',
            lineColor: '#BBD0DB',
            level: '铂金会员',
          },
          {
            bgColor: '#F2F5FF',
            wordColor: '#284EB6',
            lineColor: '#C1CBEF',
            level: '钻石会员',
          },
          {
            bgColor: '#FDF7FF',
            wordColor: '#A877C6',
            lineColor: '#DBC6E8',
            level: '钻石Ⅰ会员',
          },
          {
            bgColor: '#F8F2FF',
            wordColor: '#78439F',
            lineColor: '#958AC3',
            level: '钻石Ⅱ会员',
          },
          {
            bgColor: '#F4F2F2',
            wordColor: '#8D4581',
            lineColor: '#907B8C',
            level: '钻石Ⅲ会员',
          },
          {
            bgColor: '#F4F2F2',
            wordColor: '#502E30',
            lineColor: '#795D5E',
            level: '王者会员',
          },
        ],
        smkg_chage: false,
        informationNoBubbles: false,
        shopData: {},
      }
    },
    filters: {
      nums(val) {
        return val.toFixed(2)
      },
      images(url) {
        let arr = url.split('')
        if (arr[0] == '/') {
          return this.imgUrl + url
        } else {
          return url
        }
      },
    },
    onPageScroll(e) {
      if (e.scrollTop <= 200) {
        this.clarity = (e.scrollTop / 200).toFixed(2)
      }
    },
    onLoad(options) {
      var than = this
      this.id = options.id
      this.Disclaimers()
      /* #ifdef H5 */
      this.jinzhi()
      /* #endif */
      /* #ifndef APP-PLUS */
      var pages = getCurrentPages() //当前页
      this.beforePage = pages.length > 2 //上个页面、
      /* #endif*/
    },
    onReady() {
      /* #ifdef MP-WEIXIN*/
      this.capsuleWidth = wx.getMenuButtonBoundingClientRect().width
      /* #endif */
    },
    onShow() {
      var than = this
      this.getData(true)
      this.doorSeenLsjl()
      setTimeout(function () {
        than.weig = false
      }, 3000)
    },
    methods: {
      // 获取上门看过历史记录
      doorSeenLsjl() {
        let that = this
        this.$myRequest
          .get('/api/mobile/vehicleOwner/queryVisitedHistory', {
            userId: this.userInfo.id,
            vehicleId: this.id,
            businessType: 3,
          })
          .then((res) => {
            if (res.visitedHistory.id) {
              // 判断是上门看看还是看过
              this.smkg_chage = true
            }
          })
      },
      jubao() {
        if (!this.showLogin()) {
          return
        }
        uni.navigateTo({
          url: '/pages_owner/ownerService/report?id=' + this.jjrInfo.id + '&houseId=' + this.id,
        })
      },
      // 信息编号
      informationNos() {
        this.$refs.informationNo.informationNo_xxbh()
      },
      // 免责声明
      Disclaimers() {
        this.$myRequest
          .get('/api/mobile/public/getDisclaimersByDisclaimerLocation', {
            disclaimerLocation: '12',
          })
          .then((res) => {
            this.disclaimers = res.Disclaimers.disclaimerContent
          })
      },
      lljl() {
        if (!this.userInfo.phone) {
          return
        }
        if (this.data.userInfo.id == this.userInfo.id) {
          return
        }
        this.$myRequest
          .post('/api/mobile/public/increaseBrowsingRecord', {
            browseRecordId: this.id,
            viewersId: this.userInfo.id,
            businessType: 2,
            browsingRecords: 6,
          })
          .then((res) => {
            this.llindex = 2
          })
      },
      doorSeen() {
        uni.navigateTo({
          url: '/pages_owner/ownerService/doorSeen?type=3&id=' + this.id,
        })
      },
      fn() {
        uni.showActionSheet({
          itemList: ['分享到微信好友', '分享到微信朋友圈'],
          success: (res) => {
            console.log(res)
            this.addIntegral(3)
            let wsxcene = null
            if (res.tapIndex == 0) {
              //分享到好友 可以发送小程序
              wsxcene = 'WXSceneSession'
              uni.share({
                provider: 'weixin',
                scene: wsxcene,
                type: 5,
                title: this.data.title || this.data.entryName,
                imageUrl:
                  this.data.displayDiagram ||
                  'https://pic.bangbangtongcheng.com/static/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%88%86%E4%BA%AB.png',
                miniProgram: {
                  id: 'gh_c8b17811efca',
                  path: 'pages_owner/ownerService/servicesAvailableDetails?id=' + this.id,
                  type: 0,
                  webUrl:
                    'https://www.bangbangtongcheng.com/conven_web/#/pages_owner/ownerService/servicesAvailableDetail?id=' +
                    this.id,
                },
                // summary: "我正在看，" + this.data.title || this.data.entryName + "赶紧跟我一起来查看！",
                success: function (res) {
                  console.log('success:' + JSON.stringify(res))
                },
                fail: function (err) {
                  console.log('fail:' + JSON.stringify(err))
                },
              })
            } else {
              uni.downloadFile({
                url: this.data.displayDiagram || this.swiperList[0], //仅为示例，并非真实的资源
                success: (res) => {
                  if (res.statusCode === 200) {
                    let name = res.tempFilePath.substr(res.tempFilePath.lastIndexOf('/') + 1) //截取文件名
                    plus.zip.compressImage(
                      {
                        src: res.tempFilePath, //下载完图片的临时路径
                        dst: '_doc/photoData/' + name, //存储压缩完图片的临时路径
                        overwrite: true, //再次压缩会覆盖掉上次的目录
                        width: '150px', //缩放图片的宽度
                        height: '100px', //缩放图片的高度
                        quality: 5, //压缩图片质量,值越低,图片占内存越低
                      },
                      (event) => {
                        //压缩成功
                        wsxcene = 'WXSceneTimeline' //分享到朋友圈 只能H5 或者图片
                        uni.share({
                          provider: 'weixin',
                          scene: wsxcene,
                          type: 0,
                          title: this.data.title || this.data.entryName,
                          href:
                            'https://www.bangbangtongcheng.com/conven_web/#/pages_owner/ownerService/servicesAvailableDetail?id=' +
                            this.id,
                          imageUrl: event.target,
                          summary:
                            '我正在看，' + this.data.title ||
                            this.data.entryName ||
                            ' ' + '赶紧跟我一起来查看！',
                          success: function (res) {
                            console.log('success:' + JSON.stringify(res))
                          },
                          fail: function (err) {
                            console.log('fail:' + JSON.stringify(err))
                          },
                        })
                      },
                      (error) => {
                        //压缩失败
                        uni.showToast({
                          title: '压缩失败',
                          icon: 'none',
                        })
                      }
                    )
                  }
                },
              })
            }
          },
          fail: function (res) {
            console.log(res.errMsg)
          },
        })
      },
      titxuan(index) {
        this.titIndex = index
      },
      weigui() {
        uni.navigateTo({
          url: '/pages_intermediary/illegalBehavior?id=' + this.jjrInfo.id + '&index=2',
        })
      },
      guanzhu() {
        if (!this.userInfo.phone) {
          // uni.showToast({
          //   title: "请登录",
          //   icon: "none",
          //   mask: true,
          // });
          uni.showModal({
            title: '',
            content: '尚未登录，前往登录？',
            showCancel: true,
            success: (res) => {
              if (res.confirm) {
                //#ifdef H5
                uni.navigateTo({
                  url: '/pages/login/login?isNeedBack=true',
                })
                //#endif
                //#ifdef APP-PLUS
                uni.navigateTo({
                  url: '/pages/login/login?isNeedBack=true',
                })
                //#endif
                //#ifdef MP-WEIXIN
                uni.navigateTo({
                  url: '/pages/login/phoneLogin',
                })
                //#endif
              }
            },
          })
          return
        }
        let that = this
        this.$myRequest
          .post('/mob/user/saveUserCollection', {
            userId: this.userInfo.id,
            type: '1',
            cbType: '3',
            relationId: this.jjrInfo.id,
            cancel: this.userisCollection ? '1' : '',
          })
          .then((res) => {
            if (!this.userisCollection) {
              uni.showToast({
                title: '关注成功',
                icon: 'none',
                mask: true,
              })
              this.addIntegral(5, '关注用户')
            } else {
              uni.showToast({
                title: res.msg,
                icon: 'none',
                mask: true,
              })
            }
            this.getData()
          })
      },
      jinzhi() {
        let _this = this
        let param = window.location.href.split('#')[0]
        uni.request({
          method: 'post',
          data: {
            url: param,
          },
          header: {
            'content-type': 'application/x-www-form-urlencoded',
          },
          url: 'https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do',
          success(re) {
            _this.setWxShare(re.data)
          },
        })
      },
      setWxShare(data) {
        let _this = this
        wxshare.config({
          debug: false, //是否打开调试
          appId: data.appId, // 公众号的唯一标识
          timestamp: data.timestamp, // 生成签名的时间戳
          nonceStr: data.nonce, // ，生成签名的随机串
          signature: data.signature, // 签名
          jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData', 'openLocation'],
        })
        wxshare.ready(function () {
          //分享给朋友
          // console.log("aaaaaaaa");
          _this.addIntegral(3)
          wxshare.updateAppMessageShareData({
            title: _this.data.title || this.data.entryName, // 分享标题
            desc: _this.data.address, // 分享描述
            link: `https://www.bangbangtongcheng.com/conven_web/#/pages_owner/ownerService/servicesAvailableDetail?id=${_this.id}`, // 当前页面链接pp
            imgUrl: 'https://pic.bangbangtongcheng.com/static/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%88%86%E4%BA%AB.png', // 分享图标
            success: function () {
              //分享成功回调
            },
            cancel: function () {
              //取消分享回调
            },
          })
          wxshare.updateTimelineShareData({
            title: _this.data.title || this.data.entryName, // 分享标题
            desc: _this.data.address, // 分享描述
            link: `https://www.bangbangtongcheng.com/conven_web/#/pages_owner/ownerService/servicesAvailableDetail?id=${_this.id}`, // 当前页面链接pp
            imgUrl: 'https://pic.bangbangtongcheng.com/static/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%88%86%E4%BA%AB.png', // 分享图标
            success: function () {},
            cancel: function () {},
          })
        })
      },
      onShareAppMessage: function (res) {
        this.addIntegral(3)
        let that = this
        // console.log(that.imgUrl + that.data.logo);
        if (res.from === 'menu') {
          // 来自页面内分享按钮
          // console.log(res);
        }
        return {
          title: _this.data.title || this.data.entryName,
          path: '/pages_owner/ownerService/servicesAvailableDetail?id=' + that.id,
          desc: '找房就用帮帮同城',
          imageUrl: 'https://pic.bangbangtongcheng.com/static/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%88%86%E4%BA%AB.png',
        }
      },
      onShareTimeline() {
        this.addIntegral(3)
        return {
          title: this.data.title || this.data.entryName,
          path: '/pages_owner/ownerService/servicesAvailableDetail?id=' + this.id,
          imageUrl: 'https://pic.bangbangtongcheng.com/static/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%88%86%E4%BA%AB.png',
        }
      },
      chat() {
        if (!this.showLogin()) {
          return
        }
        uni.navigateTo({
          url: `/pages/news/chat1?receiver=${this.data.userInfo.id}&img=${this.data.userInfo.image}&nikeName=${this.data.userInfo.nikeName}&id=${this.data.id}&type=2&index=${this.indexss}`,
        })
        // if (this.indexss == 1) {
        // 	this.indexss = 2;
        // }
      },
      fanhui() {
        uni.navigateBack({
          delta: 1,
        })
      },
      shouye() {
        uni.switchTab({
          url: '/pages/index/index',
        })
      },
      userFy() {
        uni.navigateTo({
          url: '/pages_owner/dealer/goldConsultant?userId=' + this.data.userInfo.id,
        })
      },
      photos() {
        uni.navigateTo({
          url: '/pages_owner/index/seePhotos',
        })
      },
      openMap() {
        // console.log(this.data.latitude, this.data.longitude);
        let that = this
        /* #ifdef H5 */
        let param = window.location.href.split('#')[0]
        uni.request({
          method: 'post',
          data: {
            url: param,
          },
          header: {
            'content-type': 'application/x-www-form-urlencoded',
          },
          url: 'https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do',
          success(re) {
            uni.hideLoading()
            wxshare.config({
              debug: false, //是否打开调试
              appId: re.data.appId, // 公众号的唯一标识
              timestamp: re.data.timestamp, // 生成签名的时间戳
              nonceStr: re.data.nonce, // ，生成签名的随机串
              signature: re.data.signature, // 签名
              jsApiList: ['openLocation'],
            })
            wxshare.ready(function () {
              wxshare.openLocation({
                latitude: Number(that.data.latitude), //目的地latitude
                longitude: Number(that.data.longitude), //目的地longitude
                // name: that.data.title,
                // address: that.data.address,
                scale: 15, //地图缩放大小，可根据情况具体调整
              })
            })
          },
        })
        /* #endif */
        /* #ifndef H5 */
        uni.openLocation({
          latitude: Number(that.data.latitude),
          longitude: Number(that.data.longitude),
          name: that.data.address,
          success: function () {
            console.log('success')
          },
        })
        /* #endif */
      },
      sc() {
        if (!this.userinfo.phone) {
          uni.showModal({
            title: '',
            content: '尚未登录，前往登录？',
            showCancel: true,
            success: (res) => {
              if (res.confirm) {
                //#ifdef H5
                uni.navigateTo({
                  url: '/pages/login/login?isNeedBack=true',
                })
                //#endif
                //#ifdef APP-PLUS
                uni.navigateTo({
                  url: '/pages/login/login?isNeedBack=true',
                })
                //#endif
                //#ifdef MP-WEIXIN
                uni.navigateTo({
                  url: '/pages/login/phoneLogin',
                })
                //#endif
              }
            },
          })
          return
        }
        let that = this
        this.$myRequest
          .post('/api/mobile/vehicleOwner/collectionOrCancelCollection', {
            collectorId: this.userInfo.id,
            relationId: this.data.id,
            collectionType: '5',
            ids: this.data.collectionAttention ? this.data.collectionAttention.id : '',
          })
          .then((res) => {
            uni.showToast({
              title: res.msg,
              icon: 'none',
              mask: true,
            })
            if (this.data.whetherCollection == 0) {
              this.addIntegral(5, '收藏服务')
            }
            this.getData()
          })
      },
      addIntegral(val, title) {
        this.$myRequest
          .post('/mob/iteration/addIntegral', {
            userId: this.userInfo.id,
            ruleNumber: val,
            title: title || '转发服务',
          })
          .then((res) => {})
      },
      async getPhone() {
        this.onphone()
      },
      onphone() {
        if (!this.userinfo.phone) {
          uni.showModal({
            title: '',
            content: '尚未登录，前往登录？',
            showCancel: true,
            success: (res) => {
              if (res.confirm) {
                //#ifdef H5
                uni.navigateTo({
                  url: '/pages/login/login?isNeedBack=true',
                })
                //#endif
                //#ifdef APP-PLUS
                uni.navigateTo({
                  url: '/pages/login/login?isNeedBack=true',
                })
                //#endif
                //#ifdef MP-WEIXIN
                uni.navigateTo({
                  url: '/pages/login/phoneLogin',
                })
                //#endif
              }
            },
          })
          return
        }
        this.$myRequest
          .post('/api/mobile/public/increaseCallRecord', {
            userId: this.userInfo.id,
            businessType: '2',
            telephoneNumber: this.data.userInfo.phone,
            associationId: this.data.id,
            callType: 6,
          })
          .then((res) => {})
        uni.makePhoneCall({
          // 手机号
          phoneNumber: this.data.userInfo.phone,
          // 成功回调
          success: (res) => {
            console.log('调用成功!')
          },

          // 失败回调
          fail: (res) => {
            console.log('调用失败!')
          },
        })
      },
      fwxmImg(url, index) {
        wx.previewImage({
          urls: url, //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
          current: index, // 当前显示图片的http链接，默认是第一个
        })
      },
      clickImg(url, index) {
        url = url.map((v) => {
          v = this.imgUrl + v
          return v
        })
        wx.previewImage({
          urls: url, //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
          current: index, // 当前显示图片的http链接，默认是第一个
          indicator: 'number',
          success: function (res) {},
          fail: function (res) {},
          complete: function (res) {},
        })
      },
      getCollection(id) {
        if (!this.userInfo.phone) {
          return
        }
        this.$myRequest
          .get('/mob/user/getIsCollection', {
            userId: this.userInfo.id,
            cbType: 3,
            type: 1,
            relationId: id,
          })
          .then((res) => {
            // console.log(res);
            this.userisCollection = res.isCollection
          })
      },
      getData(status) {
        let that = this
        this.$myRequest
          .get('/api/mobile/vehicleOwner/getOwnerServiceById', {
            id: this.id,
            userId: this.userInfo.id,
          })
          .then((res) => {
            this.data = res.serviceItems
            if (this.llindex == 1) {
              this.lljl()
            }
            this.swiperList = res.serviceItems.projectPicture.split('|')
            this.video = res.serviceItems.entryVideo
            this.jjrInfo = res.serviceItems.userInfo
            that.getCollection(res.serviceItems.userInfo.id)
            that.getShopDetail(res.serviceItems.storeId)
            if (res.serviceItems.latitude) {
              this.markerList = [
                {
                  id: 1,
                  latitude: res.serviceItems.latitude,
                  longitude: res.serviceItems.longitude,
                  iconPath: 'https://pic.bangbangtongcheng.com/locationpic.png',
                  width: 30,
                  height: 30,
                  anchor: {
                    x: 0.5,
                    y: 0.5,
                  },
                },
              ]
            }
          })
      },

      // 查询门店信息
      async getShopDetail(id) {
        let that = this
        await this.$myRequest
          .get('/api/mobile/vehicleOwner/getDistributorById', {
            id: id,
            userId: this.userInfo.id,
          })
          .then((res) => {
            this.shopData = res.distributorList || {}
            console.log(this.shopData)
          })
      },
      swiperC1(e) {
        this.current = e.detail.current
      },
      //点击更多按钮
      Mores() {
        let that = this
        uni.showActionSheet({
          itemList: ['转发'],
          success: function (res) {
            console.log('选中了第' + (res.tapIndex + 1) + '个按钮')
            if (res.tapIndex + 1 == 1) {
              that.fn()
            }
          },
          fail: function (res) {
            console.log(res.errMsg)
          },
        })
      },
    },
    computed: {
      ...mapGetters(['userid', 'islogin', 'statusBarHeight1', 'userinfo']),
    },
  }
</script>
<style lang="less" scoped>
  .box {
    background: #fff;
  }

  .anamorphism {
    background-image: linear-gradient(to bottom, rgba(51, 51, 51, 0.4), rgba(255, 255, 255, 0));
  }

  .new-title-wrapper {
    background-color: red;
    width: 100%;
    height: 88rpx;
    z-index: 1;
    position: fixed;
    top: 0;
    left: 0;
  }

  .title1 {
    margin: 0 30rpx;
    font-size: 46rpx;
    font-weight: 600;
    line-height: 60rpx;
  }

  .xmtitle {
    height: 120rpx;
    width: 100%;
    line-height: 60rpx;
    padding: 0 30rpx;
    font-size: 40rpx;
    font-weight: 550;
    color: #64b6a8;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .name {
      width: calc(100% - 70rpx);
    }

    .jubao {
      image {
        margin-top: 0;
        width: 58rpx;
        height: 58rpx;
      }

      view {
        text-align: center;
        font-size: 24rpx;
        line-height: 1;
        color: #333333;
      }
    }
  }

  .jieshao {
    width: 100%;

    .name {
      font-size: 34rpx;
      color: #333333;
      margin: 30rpx 30rpx 0;
    }

    .name {
      display: flex;
      align-items: center;
      justify-content: space-between;

      .name_left {
        font-size: 34rpx;
        font-weight: 400;
        color: #333333;
      }

      .name_right {
        display: flex;
        align-items: center;

        .name_right_image {
          width: 34rpx;
          height: 36rpx;
          margin-top: 0;
        }

        .name_right_txt {
          margin-left: 8rpx;
          font-size: 24rpx;
          font-weight: 400;
          color: #64b6a8;
        }
      }
    }

    .detail {
      word-break: break-all;
      padding-top: 40rpx;
    }
  }

  .technicianWill {
    margin: 0 30rpx;
    margin-top: 40rpx;

    .name {
      font-size: 34rpx;
      font-weight: 400;
      color: #333333;
    }

    .photograph {
      .image1 {
        width: 690rpx;
        height: 260rpx;
        border-radius: 16rpx;
      }

      .photograph_item {
        display: flex;
        align-items: center;
        justify-content: space-between;

        .image2 {
          width: 332rpx;
          height: 150rpx;
          border-radius: 8rpx;
        }

        .image3 {
          width: 332rpx;
          height: 150rpx;
          border-radius: 8rpx;
          position: relative;
          margin-top: 20rpx;

          .loadMore {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, 0.62);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 24rpx;
            border-radius: 8rpx;
          }
        }
      }
    }
  }

  .mzsm {
    font-size: 24rpx;
    font-weight: 400;
    color: #989898;
    margin: 0 30rpx;
    margin-top: 40rpx;
  }

  .dibu {
    position: fixed;
    bottom: -2rpx;
    margin-top: 36rpx;
    width: 100%;
    height: calc(120rpx + env(safe-area-inset-bottom) / 2);
    background: #ffffff;
    box-shadow: 0px 0px 6rpx rgba(0, 0, 0, 0.16);
    padding-bottom: calc(8rpx + env(safe-area-inset-bottom) / 2);
    box-sizing: content-box;

    .zhiwei {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      width: 240rpx;
      position: absolute;
      // top: rpx;
      left: 30rpx;
      font-size: 28rpx;
      vertical-align: middle;

      .xin {
        // display: flex;
        height: 100rpx;
        width: 100rpx;
        position: fixed;
        bottom: calc(-2% + env(safe-area-inset-bottom) / 2);
        left: 15%;

        .img3 {
          width: 20rpx;
          height: 20rpx;
        }
      }

      .img {
        vertical-align: middle;
        width: 80rpx;
        height: 80rpx;
        margin-right: 12rpx;
        border-radius: 80rpx;
      }
    }

    .shou {
      position: absolute;

      left: 250rpx;
      font-size: 24rpx;
      width: 120rpx;
      text-align: center;

      .img {
        vertical-align: middle;
        width: 54rpx;
        height: 54rpx;
        // margin-left: 24rpx;
      }
    }

    .lian {
      position: absolute;
      left: 400rpx;
      font-size: 24rpx;

      .img {
        vertical-align: middle;
        width: 54rpx;
        height: 54rpx;
        margin-left: 12rpx;
      }
    }

    .liao {
      position: absolute;
      top: 35rpx;
      right: 22rpx;
      width: 200rpx;
      height: 70rpx;
      background: #64b6a8;
      border-radius: 36rpx;
      text-align: center;
      line-height: 70rpx;
      color: #fff;
    }

    .weigui {
      position: absolute;
      padding: 0px 10px 0px 10px;
      width: 690rpx;
      left: 30rpx;
      bottom: 0rpx;
      animation: all 6s;
      animation-name: mycolor;

      // mycolor 2s linear 3s infinite alternate
      .img {
        width: 100%;
        height: 134rpx;
      }

      p {
        position: absolute;
        left: 100rpx;
        bottom: 64rpx;
        font-size: 34rpx;
        color: #fff;
      }
    }

    @keyframes mycolor {
      0% {
        left: 30rpx;
        bottom: 140rpx;
        transform: scale(0 0.1);
      }

      100% {
        left: 30rpx;
        bottom: 140rpx;
        opacity: 0;
      }
    }
  }

  .headTop {
    width: 100%;
    height: 88rpx;
    position: fixed;
    top: 0;
    z-index: 100000;
    background-color: #fff;
    box-sizing: content-box;
    display: flex;
    align-items: center;
    justify-content: space-between;

    /* #ifdef MP-WEIXIN */
    // height: 120rpx;
    // padding-top: 10%;
    /* #endif */
    .image1 {
      width: 50rpx;
      height: 50rpx;
      margin-top: 0;
      margin-left: 30rpx;
    }

    .xmxq {
      font-size: 36rpx;
      font-weight: 550;
      color: #333333;
    }

    .image2 {
      width: 50rpx;
      height: 50rpx;
      margin-top: 0;
      margin: 0 20rpx;
    }

    .dianbi {
      font-size: 34rpx;
    }

    .fenxiang {
      font-size: 34rpx;
    }
  }

  .box {
    width: 100%;
    background-color: #fff;
    padding-bottom: 160rpx;
    margin-top: 0 !important;

    .fenxiang {
      width: 50px;

      height: 50rpx;
      background-color: rgb(127, 127, 127);
      color: #fff;
      border-radius: 10%;
      line-height: 50rpx;
      text-align: center;
      position: fixed;
      font-size: 12px;

      top: 6%;
      // right: 10%;
      right: 5%;
      z-index: 10000000 !important;
      /* #ifdef APP */
      line-height: 40rpx;
      /* #endif */
    }

    .Wfanhui {
      width: 100rpx;
      height: 100rpx;
      border-radius: 100rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000000 !important;
      position: fixed;
      top: 4.5%;

      // left: 15px;
      .fanhui {
        width: 50rpx;
        height: 50rpx;
        border-radius: 50rpx;
        background-color: #64b6a8;
      }
    }
  }

  .tit {
    position: relative;
    width: 100%;
    height: 500rpx;
    /* #ifdef APP-PLUS */
    height: auto;
    /* #endif */
    /* #ifdef MP-WEIXIN */
    height: auto;
    /* #endif */

    video {
      width: 100%;
      height: 500rpx;
      max-width: 100%;
    }

    .video {
      width: 100%;
      height: 500rpx;
      max-width: 100%;
      position: relative;
    }

    .butbox {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      bottom: 40rpx;
      z-index: 1;

      .tu {
        display: inline-block;
        // width: 200rpx;
        height: 50rpx;
        border-radius: 30rpx;
        background: #ffffff;
        // margin-left: 24rpx;
        // margin-right: 180rpx;
      }

      .but {
        display: inline-block;
        text-align: center;
        line-height: 52rpx;
        width: 100rpx;
        height: 50rpx;
        background: #ffffff;
        border-radius: 30rpx;
      }

      .xuan {
        background: #64b6a8;
        color: #fff;
      }
    }

    .rotaryCastDiagram {
      position: absolute;
      right: 30rpx;
      bottom: 30rpx;
      text-align: center;
      line-height: 50rpx;
      width: 100rpx;
      height: 50rpx;
      background-color: rgba(51, 51, 51, 0.65);
      border-radius: 31rpx;
      color: #fff;
      font-size: 26rpx;
    }
  }

  .tit {
    .image1 {
      position: fixed;
      width: 50rpx;
      height: 50rpx;
      top: 40rpx;
      left: 0;
      background-color: rgb(127, 127, 127);
      border-radius: 50%;
      left: 30rpx;
      z-index: 10001;
    }
  }

  .tou {
    position: absolute;
    top: 0;
    width: 100%;
    // height: 88rpx;
    text-align: center;
    line-height: 88rpx;
    font-size: 36rpx;
    color: #fff;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9999;

    .image1 {
      // position: absolute;
      position: fixed;
      width: 50rpx;
      height: 50rpx;
      top: 40rpx;
      left: 0;
      // top: 116rpx;
      // margin-bottom: 10px;
      background-color: rgb(127, 127, 127);
      border-radius: 50%;
      left: 30rpx;
      z-index: 1001;

      /* #ifdef MP-WEIXIN */
      width: 50rpx;
      height: 50rpx;
      top: 78rpx;
      /* #endif */
    }

    .image2 {
      position: absolute;
      width: 56rpx;
      height: 56rpx;
      right: 30rpx;
    }

    .dianbi {
      width: 30px;
      height: 30px;
      background-color: rgba(0, 0, 0, 0.5);
      color: #fff;
      border-radius: 50%;
      line-height: 30px;
      position: fixed;
      font-size: 12px;
      top: 4%;
      /* #ifdef MP-WEIXIN */
      top: 10%;
      /* #endif */
      right: 0%;
      z-index: 10000000;
    }
  }

  image {
    width: 100%;
    margin-top: 10px;
  }

  .informationNoBubble {
    width: 500rpx;
    padding: 10rpx;
    border-radius: 10rpx;
    background-color: #ffffff;
    position: absolute;
    bottom: -150rpx;
    border: 1px solid #888;
    left: 150rpx;
    z-index: 1;

    .binds_1 {
      font-size: 24rpx;
      font-weight: 400;
      color: #333333;
      margin-bottom: 10rpx;
    }

    .binds_2 {
      font-size: 24rpx;
      font-weight: 400;
      color: #64b6a8;
    }

    &::before {
      width: 0px;
      height: 0px;
      position: absolute;
      padding: 0;
      border-left: 24rpx solid transparent;
      border-right: 20rpx solid transparent;
      border-bottom: 24rpx solid #fff;
      content: '';
      z-index: 12;
      position: absolute;
      left: 12rpx;
      top: -20rpx;
    }

    &::after {
      width: 0px;
      height: 0px;
      position: absolute;
      padding: 0;
      border-left: 24rpx solid transparent;
      border-right: 20rpx solid transparent;
      border-bottom: 24rpx solid #888;
      content: '';
      z-index: 10;
      position: absolute;
      left: 12rpx;
      top: -24rpx;
    }
  }

  .carPosition {
    margin: 0 30rpx;
    margin-top: 40rpx;

    .name {
      font-size: 34rpx;
      font-weight: 400;
      color: #333333;
      margin-bottom: 16rpx;
    }

    .map {
      width: 690rpx;
      height: 325rpx;
      border-radius: 16rpx;
      overflow: hidden;
      .AppMap {
        width: 100%;
        height: 100%;
      }
    }
  }

  .mingpian {
    position: relative;
    width: 690rpx;
    height: 200rpx;
    background: #ffffff;
    box-shadow: 0px 0px 6rpx rgba(0, 0, 0, 0.16);
    border-radius: 18rpx;
    margin-top: 40rpx;
    margin-left: 30rpx;

    .vip-label {
      position: absolute;
      top: 80rpx;
      left: 174rpx;
      text-align: center;
      padding: 3rpx 0;
      background: #f6f0ff;
      border-radius: 6rpx 6rpx 6rpx 6rpx;
      opacity: 1;
      border: 2rpx solid #bd90d9;
      font-size: 24rpx;
      font-weight: 500;
      color: #bd90d9;
    }

    .name {
      position: absolute;
      top: 30rpx;
      left: 174rpx;
      font-size: 36rpx;
      width: 300rpx;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }

    .img1 {
      position: absolute;
      top: 10%;
      left: 30rpx;
      width: 120rpx;
      height: 120rpx;
      border-radius: 50%;
    }

    .img2 {
      position: absolute;
      bottom: 40rpx;
      left: 40rpx;
      width: 100rpx;
      height: 36rpx;
      background: url('https://pic.bangbangtongcheng.com/static/name.png');
      background-size: 100% 100%;
      font-size: 20rpx;
      color: #fff;
      text-align: center;
      line-height: 36rpx;
    }

    .zhiwei {
      position: absolute;
      top: 132rpx;
      left: 54rpx;
      font-size: 20rpx;
      color: #fff;
    }

    .xin {
      position: absolute;
      top: 102rpx;
      left: 170rpx;

      .img3 {
        width: 40rpx;
        height: 40rpx;
      }
    }

    .chakan {
      position: absolute;
      top: 0;
      right: 0;
      width: 200rpx;
      height: 60rpx;
      background: #64b6a8;
      border-radius: 0px 18rpx 0px 18rpx;
      text-align: center;
      line-height: 60rpx;
      color: #fff;
      font-size: 24rpx;
    }

    .img4 {
      position: absolute;
      top: 100rpx;
      left: 530rpx;
      width: 54rpx;
      height: 54rpx;
    }

    .guan {
      position: absolute;
      bottom: 37rpx;
      right: 40rpx;
    }
  }
</style>
